function _form_collect_data(thisform) {
	var s_data = "";
	for (var i = 0; i < thisform.elements.length; i++) {
		if (thisform.elements[i].tagName.toLowerCase() == "input" && 
				(thisform.elements[i].type.toLowerCase() == "checkbox" || thisform.elements[i].type.toLowerCase() == "radio") && 
				!thisform.elements[i].checked) {
			continue;
		} else if (thisform.elements[i].tagName.toLowerCase() == "select") {
			for (var j = 0; j < thisform.elements[i].options.length; j++) {
				if (thisform.elements[i].options[j].selected) {
					s_data += "&" + thisform.elements[i].name + "=" + encodeURIComponent(thisform.elements[i].options[j].value);
				}
			}
		} else {
			s_data += "&" + thisform.elements[i].name + "=" + encodeURIComponent(thisform.elements[i].value);
		}
	}
	return s_data.substring(1);
}

function _ajax_submit(thisform, fn_success, fn_failure) {
    $.ajax({
        type: "POST",
        url: thisform.action,
        timeout: 600000,
        data: _form_collect_data(thisform),
        success: fn_success,
        error: fn_failure
    });
}

function _ajax_request(module, action, params, fn_success, fn_failure) {
    // This function require Prototype library
    var url = "index.php?_m=" + module + "&_a=" + action;
    // Reform query string
    for (key in params) {
       url += "&" + key + "=" + params[key];
    }
    
    $.ajax({
        type: "GET",
        url: url,
        success: fn_success,
        error: fn_failure
    });
}

function reloadPage()
{
	window.location.reload();
}

$(document).ready(function(){
	$('.ll').hover(function(){
		$(this).css('background','#acc968');
	},function(){
		$(this).css('background','#f5f5f5');
	});
});